//ordermsg.js

Page({
  data: {
    orderstate:'1',
    peimode: '1',
    pickUpCodelayer: true,
    pickUpStatus: '0',
    refund: true,
    orderLogistics: true,
    confirmreceipt: true,
    animationData: {},
    animationDatas:{}
  },
  onLoad: function () {
    let that = this;

  },
  pickUpCode: function () {
    let that = this;
    that.setData({
        pickUpCodelayer: false
    })
  },
  pickUpCodeClose: function () {
    let that = this;
    that.setData({
        pickUpCodelayer: true
    })
  },
   orderLogistics: function () {
    let that = this;
    that.setData({
      orderLogistics: false
      }, () => {
        let animation = wx.createAnimation({
            duration: 500,
            timingFunction: 'ease'
        })
         that.animation = animation
         setTimeout(function(){
           that.big();
        },200)
    })
  },
  orderLogisticsClose: function () {
    let that = this;
    that.setData({
      orderLogistics: true
      }, () => {
        let animation = wx.createAnimation({
            duration: 500,
            timingFunction: 'ease'
        })
         that.animation = animation
         setTimeout(function(){
           that.small();
        },200)
    })
  },
  big: function () {
    let that = this;
    that.animation.scale(1).step()
    that.setData({
      animationData: that.animation.export()
    })
  },
  small: function () {
    let that = this;
    that.animation.scale(0).step()
    that.setData({
      animationData: that.animation.export()
    })
  },
  applicationRefund: function () {
    // wx.showToast({
    //   title: '本产品已超过退货期限,不可退货',
    //   icon: 'none',
    //   duration: 2000
    // })
    wx.navigateTo({
        url: '/packageA/pages/returngoods/returngoods'
    })
  },
  returnDetail: function () {
    wx.navigateTo({
        url: '/packageA/pages/returndetail/returndetail'
    })
  },
  confirmReceipt: function () {
    let that = this;
    that.setData({
      confirmreceipt: false
      }, () => {
        let animation = wx.createAnimation({
            duration: 500,
            timingFunction: 'ease'
        })
         that.animation = animation
         setTimeout(function(){
           that.bigs();
        },200)
    })
  },
  confirmReceiptClose: function () {
    let that = this;
    that.setData({
      confirmreceipt: true
      }, () => {
        let animation = wx.createAnimation({
            duration: 500,
            timingFunction: 'ease'
        })
         that.animation = animation
         setTimeout(function(){
           that.smalls();
        },200)
    })
  },
  bigs: function () {
    let that = this;
    that.animation.scale(1).step()
    that.setData({
      animationDatas: that.animation.export()
    })
  },
  smalls: function () {
    let that = this;
    that.animation.scale(0).step()
    that.setData({
      animationDatas: that.animation.export()
    })
  },
  contactSellers: function () {
    wx.makePhoneCall({
        phoneNumber: '11111'
    })
  },
  orderNumMsg: function (e) {
    wx.setClipboardData({
      data: e.currentTarget.dataset.text,
      success: function (res) {
        wx.getClipboardData({
          success: function (res) {
            wx.showToast({
              title: '复制成功'
            })
          }
        })
      }
    })
  }
})
